<?php
/**
 * Created by PhpStorm.
 * User: 低调
 * Date: 2018/5/21
 * Time: 21:55
 */
//用于显示文章详情
include("../connectdb.php");
include("head.php");
$id = $_GET['id'];
$sql = "SELECT * FROM Article WHERE `id`='$id'";
$result = mysqli_fetch_array(mysqli_query($conn,$sql));
if(!$result)
    echo "<script>alert('无法查看');location.href='index.php';</script>";
?>

<!-- 内容区域 -->
<div class="tpl-content-wrapper">

    <div class="row-content am-cf">

        <div class="row">

            <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                <div class="widget am-cf">
                    <div class="widget-head am-cf">
                        <div class="widget-title am-fl">文章详情</div>
                        <div class="widget-function am-fr">
                            <a href="javascript:;" class="am-icon-cog"></a>
                        </div>
                    </div>
                    <div class="widget-body am-fr">

                        <form class="am-form tpl-form-line-form">
                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">标题 <span class="tpl-form-line-small-title">Title</span></label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" id="user-name" value="<?php echo $result['title'];?>" disabled>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label for="user-phone" class="am-u-sm-3 am-form-label">作者 <span class="tpl-form-line-small-title">Author</span></label>
                                <div class="am-u-sm-9">
                                    <input class="am-form-field tpl-form-no-bg" disabled="disabled" value="<?php echo $result['author'];?>">
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-weibo" class="am-u-sm-3 am-form-label">文章分类 <span class="tpl-form-line-small-title">Type</span></label>
                                <div class="am-u-sm-9">
                                    <input type="text" id="user-weibo" value="<?php echo $result['type'];?>" disabled>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-email" class="am-u-sm-3 am-form-label">发布时间 <span class="tpl-form-line-small-title">Time</span></label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="am-form-field tpl-form-no-bg" value="<?php echo $result['time'];?>" disabled>
                                    <small>文章发布时间</small>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-intro" class="am-u-sm-3 am-form-label">文章内容</label>
                                <div class="am-u-sm-9">
                                    <textarea class="" rows="10" id="user-intro" disabled><?php echo $result['content'];?></textarea>
                                </div>
                            </div>

                        </form>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>